{% extends "base.html" %}

{% block body %}

<!-- Page Heading -->
<div class="d-sm-flex align-items-center justify-content-between mb-4">
  <h1 class="h3 mb-0 text-gray-800">Projects</h1>
    <div >
      {% if username=="root" %}
        <a href="#" data-toggle="modal" data-target="#addProjectModal" class="d-none d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-plus fa-sm text-white-50"></i> Create Project</a>
      {% end %}
      <a href="#" class="d-none d-sm-inline-block btn btn-sm btn-primary shadow-sm" onclick="refresh_projects()"><i class="fas fa-undo fa-sm text-white-50"></i> Refresh</a>
  </div>
</div>

<!-- Projects -->
<div id="projects" class="row">
</div>

<!-- Create Project Modal -->
<div class="modal fade" id="addProjectModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Create Project</h5>
        <button class="close" type="button" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">×</span>
        </button>
      </div>
      <div class="modal-body">
        <form>
          <div class="form-group">
            <label>Project Description (Max 20 chars)</label>
            <input class="form-control" id="description" aria-describedby="descriptionHelp" placeholder="Enter Project Description">
          </div>
          <div class="form-group">
            <label>Owner</label>
            <select class="form-control" id="owner">
            </select>
          </div>
          <div class="form-group">
            <label>SSID (Max 30 chars)</label>
            <div class="row">
              <div class="col">
                <input id="ssid" type="text" class="form-control" placeholder="SSID">
              </div>
              <div class="col my-auto">
                <div class="custom-control custom-switch">
                  <input type="checkbox" class="custom-control-input" id="ssidType">
                  <label class="custom-control-label" for="ssidType">Shared SSID</label>
                </div>
              </div>
            </div>
          </div>
          <div class="form-group">
            <label>MCC/MNC</label>
            <div class="row">
              <div class="col">
                <input id="mcc" type="text" class="form-control" placeholder="MCC">
              </div>
              <div class="col">
                <input id="mnc" type="text" class="form-control" placeholder="MNC">
              </div>
            </div>
          </div>
        </form>
      </div>
      <div class="modal-footer">
        <a href="#" data-dismiss="modal" class="d-none d-sm-inline-block btn btn-sm btn-secondary shadow-sm"><i class="fas fa-sm text-white-50"></i>Cancel</a>
        <a href="#" onclick="create_project()" data-toggle="modal" data-target="#addWtpModal" class="d-none d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-sm text-white-50"></i>Create</a>
      </div>
    </div>
  </div>
</div>

{% end %}

{% block js %}
<script src="/static/js/empower-index.js"></script>
{% end %}
